package org.lanqiao.tjut.control;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.lanqiao.tjut.bean.PaysEntity;
import org.lanqiao.tjut.service.IUserInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller

public class PayControl {
	// 组合service层，依赖注入
	@Resource
	private IUserInfoService userService;

	@RequestMapping("/QueryPayInfo.do")
	public ModelAndView doPayQuery(HttpSession session,PaysEntity payE) {
		
		// 创建一个modelandview对象
		ModelAndView model = new ModelAndView();
		List<PaysEntity> lstUser = userService.selectPayInfoByParas(payE);
		if (lstUser != null && lstUser.size() > 0) {
			// 登录成功
            
			// 登录验证成功，将用户信息进行session缓存
			session.setAttribute("QueryPayInfo", lstUser);
			// 设置逻辑视图名--登录成功
			model.setViewName("PayManager");
		} else {
			// 设置逻辑视图名--登录验证失败
			model.setViewName("error");
		}
		return model;
	}
	
	
	
}
